package com.a.lib_base.base.ui

import android.os.Bundle
import androidx.lifecycle.ViewModel
import androidx.viewbinding.ViewBinding
import com.a.lib_base.base.viewmodel.BaseOwnerViewModel
import com.a.lib_utils.TipUtil

abstract class BaseMVIActivity<VB : ViewBinding> : BaseViewModelActivity<VB>() {

    protected abstract fun onInitView()
    protected open fun onInitData() {}
    protected open fun onOutput() {}
    protected open fun onInput() {}

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        initViewModel()
        onInitView()
        onInitData()
        onOutput()
        onInput()
    }


    fun <T : BaseOwnerViewModel> getActivityOwnerViewModel(modelClass: Class<T>): T {
        val activityViewModel = super.getActivityViewModel(modelClass)
        activityViewModel.owner=this
        return activityViewModel
    }



}